export const tableConfig = {
	showIndexColumn: false,
	showSelectColumn: false,
	childrenProps: { rowKey: 'id' },
	propList: [
		{ prop: 'menuName', label: '菜单名称' },
		{ prop: 'menuType', label: '类型', slotName: 'menuType' },
		{ prop: 'icon', label: '图标' },
		{ prop: 'orderNum', label: '排序' },
		{ prop: 'path', label: '菜单路径' },
		{ prop: 'status', label: '状态', slotName: 'status' },
		{ prop: 'createTime', label: '创建时间', minWidth: '90' },
		{ slotName: 'handler', label: '操作', minWidth: '100' }
	]
}

export const rules = {
	// menuType: [{ required: true, message: '请选择菜单类型', trigger: 'change' }],
	parentId: [{ required: true, message: '请选择上目录', trigger: 'change' }],
	menuName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
	icon: [{ required: true, message: '请输入菜单图标', trigger: 'blur' }],
	path: [
		{ required: true, message: '请输入菜单地址', trigger: 'blur' },
		{
			pattern: /^\//,
			message: '请以 / 开头',
			trigger: 'blur'
		}
	],
	component: [
		{ required: true, message: '请输入组件路径', trigger: 'blur' },
		{
			pattern: /^\/.*\.vue$/,
			message: '请以 / 开头，.vue 结尾',
			trigger: 'blur'
		}
	],
	linkUrl: [{ required: true, message: '请输入外链接地址', trigger: 'blur' }]
}
